package com.example.programming.sys.mapper;

import com.example.programming.sys.entity.Student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 学生表 Mapper 接口 chrimer
 * </p>
 *
 * @author chrimer
 * @since 2020-07-01
 */
public interface StudentMapper extends BaseMapper<Student> {

    @Select("select speed_of_progress as x, count(speed_of_progress) as y from student where couid = #{id} GROUP BY speed_of_progress ")
    List<Map<Integer,Integer>> completeInfo(Integer id);

    @Select("select achievement from student where couid = #{id} ")
    List<Long> getGradeTotal(Integer id);
}
